package com.ruoyi.business.domain.enums;

import lombok.Getter;

@Getter
public enum HeightWeightGradeEnum {
    GRADE_1("1","正常"),
    GRADE_2("2","低体重"),
    GRADE_3("3","超重"),
    GRADE_4("4","肥胖");

    private final String code;
    private final String value;

    HeightWeightGradeEnum(String code, String value) {
        this.code = code;
        this.value = value;
    }

    public static HeightWeightGradeEnum getGrade(String code) {
        for (HeightWeightGradeEnum grade : HeightWeightGradeEnum.values()) {
            if (grade.getCode().equals(code)) {
                return grade;
            }
        }
        return null;
    }
}